package oa.system

import grails.converters.JSON

class SuperController {

    def dataSource

    def index() {
        render "超级管理员才能访问到哦！"
    }

    def ajax_execSQL(String sql) {
    }

    def execSQL(String sql) {
        List list
        if (sql != null && sql != "") {
            // 执行查询
            def db = new groovy.sql.Sql (dataSource)
            try {
                list =  db.rows(sql)
            }
            finally {
                db.close()
            }
        }
        return [sql: sql, list: list]
    }
}
